package com.zhonghui.modlules.product.eshopVo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

@TableName("store_product_attr")
public class StoreProductAttr implements Serializable {
    @TableId
    private Long id;
    private Long productId;
    private String attrName;
    private String attrValues;

    public void copy(StoreProductAttr source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static StoreProductAttr.StoreProductAttrBuilder builder() {
        return new StoreProductAttr.StoreProductAttrBuilder();
    }

    public Long getId() {
        return this.id;
    }

    public Long getProductId() {
        return this.productId;
    }

    public String getAttrName() {
        return this.attrName;
    }

    public String getAttrValues() {
        return this.attrValues;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public void setProductId(final Long productId) {
        this.productId = productId;
    }

    public void setAttrName(final String attrName) {
        this.attrName = attrName;
    }

    public void setAttrValues(final String attrValues) {
        this.attrValues = attrValues;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof StoreProductAttr)) {
            return false;
        } else {
            StoreProductAttr other = (StoreProductAttr)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label59: {
                    Object this$id = this.getId();
                    Object other$id = other.getId();
                    if (this$id == null) {
                        if (other$id == null) {
                            break label59;
                        }
                    } else if (this$id.equals(other$id)) {
                        break label59;
                    }

                    return false;
                }

                Object this$productId = this.getProductId();
                Object other$productId = other.getProductId();
                if (this$productId == null) {
                    if (other$productId != null) {
                        return false;
                    }
                } else if (!this$productId.equals(other$productId)) {
                    return false;
                }

                Object this$attrName = this.getAttrName();
                Object other$attrName = other.getAttrName();
                if (this$attrName == null) {
                    if (other$attrName != null) {
                        return false;
                    }
                } else if (!this$attrName.equals(other$attrName)) {
                    return false;
                }

                Object this$attrValues = this.getAttrValues();
                Object other$attrValues = other.getAttrValues();
                if (this$attrValues == null) {
                    if (other$attrValues != null) {
                        return false;
                    }
                } else if (!this$attrValues.equals(other$attrValues)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof StoreProductAttr;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $productId = this.getProductId();
        result = result * 59 + ($productId == null ? 43 : $productId.hashCode());
        Object $attrName = this.getAttrName();
        result = result * 59 + ($attrName == null ? 43 : $attrName.hashCode());
        Object $attrValues = this.getAttrValues();
        result = result * 59 + ($attrValues == null ? 43 : $attrValues.hashCode());
        return result;
    }

    public String toString() {
        return "StoreProductAttr(id=" + this.getId() + ", productId=" + this.getProductId() + ", attrName=" + this.getAttrName() + ", attrValues=" + this.getAttrValues() + ")";
    }

    public StoreProductAttr(final Long id, final Long productId, final String attrName, final String attrValues) {
        this.id = id;
        this.productId = productId;
        this.attrName = attrName;
        this.attrValues = attrValues;
    }

    public StoreProductAttr() {
    }

    public static class StoreProductAttrBuilder {
        private Long id;
        private Long productId;
        private String attrName;
        private String attrValues;

        StoreProductAttrBuilder() {
        }

        public StoreProductAttr.StoreProductAttrBuilder id(final Long id) {
            this.id = id;
            return this;
        }

        public StoreProductAttr.StoreProductAttrBuilder productId(final Long productId) {
            this.productId = productId;
            return this;
        }

        public StoreProductAttr.StoreProductAttrBuilder attrName(final String attrName) {
            this.attrName = attrName;
            return this;
        }

        public StoreProductAttr.StoreProductAttrBuilder attrValues(final String attrValues) {
            this.attrValues = attrValues;
            return this;
        }

        public StoreProductAttr build() {
            return new StoreProductAttr(this.id, this.productId, this.attrName, this.attrValues);
        }

        public String toString() {
            return "StoreProductAttr.StoreProductAttrBuilder(id=" + this.id + ", productId=" + this.productId + ", attrName=" + this.attrName + ", attrValues=" + this.attrValues + ")";
        }
    }
}

